import './pop.css'
import template from './pop.tmp'

const pop = document.createElement('div')

document.body.appendChild(pop)
pop.innerHTML = template


pop.children[0].onclick = function () {
    pop.children[0].style.display = 'none'
}

//防止点击遮罩内部弹窗主体时弹窗关闭,在主体加入相同事件且阻止
pop.children[0].children[0].onclick = function (e) {
    e.stopPropagation();
    console.log(pop.children[0].children[0])
}

export default {
    show() {
        pop.children[0].style.display = 'block'
    },
    load(html) {
        pop.children[0].children[0].innerHTML = html;
        return pop.children[0].children[0]
    },
    hide() {
        pop.children[0].style.display = 'none'
    }
}

